Total Complexity | 3 |
Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | export default class ValidationError extends Error { |
||
2 | constructor(cottus, errors) { |
||
3 | super(); |
||
4 | this.cottus = cottus; |
||
5 | this.errors = errors; |
||
6 | } |
||
7 | |||
8 | toJSON() { |
||
9 | return { |
||
10 | code : 'VALIDATION_ERROR', |
||
11 | details : this.errors.map(e => e.hash) |
||
12 | }; |
||
13 | } |
||
14 | } |
||
15 |